package com.oracle.sbdb.util;

import java.util.HashMap;
import java.util.Map;

public class StatusUtil {
	private static final Map<Integer, String> integer2String = loadMap();
	private static final Map<String, Integer> string2Integer = loadReverseMap();
	private static Map<Integer, String> loadMap(){
		Map<Integer, String> map = new HashMap<Integer, String>();
		map.put(10,"Description Phase");
		map.put(11,"Code/Hardware Bug (Response/Resolution)");
		map.put(14,"Bug Assigned to Solution Partner");
		map.put(16,"Bug Screening/Triage");
		map.put(17,"Work In Progress");
		map.put(24,"Deferred, Awaiting Engineering");
		map.put(25,"Open, Awaiting Code/Hardware Review");
		map.put(26,"Open/Failed Verification");
		map.put(30,"More Information Requested. To Filer");
		map.put(31,"Could Not Reproduce. To Filer");
		map.put(32,"Not a Bug. To Filer");
		map.put(33,"Suspended, Reqd Info not Avail");
		map.put(35,"To Filer for Review");
		map.put(36,"Duplicate Bug. To Filer");
		map.put(39,"Approved, waiting for codeline to open");
		map.put(40,"Waiting for the base bug fix");
		map.put(43,"Product/Platform Obsolete. To Filer");
		map.put(44,"Not Feasible to fix. To Filer");
		map.put(45,"Vendor OS/Software/Framework Problem");
		map.put(60,"Fix/Enhancement Avble,Awaiting Promotion");
		map.put(66,"CM: Awaiting Deployment");
		map.put(74,"Closed, Code/Hardware Fix Verified");
		map.put(75,"Closed, Code/Hardware Fix Not Verified");
		map.put(80,"Development to QA/Fix Delivered Internal");
		map.put(81,"QA to Dev/Patch or Workaround Avble");
		map.put(83,"Closed, Product/Platform Obsolete");
		map.put(84,"Closed, not feasible to fix");
		map.put(87,"Fix verified/Merge Required");
		map.put(90,"Closed, Verified by Filer");
		map.put(91,"Closed, Could Not Reproduce");
		map.put(92,"Closed, Not a Bug");
		map.put(93,"Closed, Not Verified by Filer");
		map.put(95,"Closed Vendor OS/Software/Framework Prob");
		map.put(96,"Closed, Duplicate Bug");
		return map;
	}
	private static Map<String, Integer> loadReverseMap() {
		Map<String, Integer> map = new HashMap<String, Integer>();
		for(int key : integer2String.keySet()){
			String value = integer2String.get(key);
			map.put(value, key);
		}
		return map;
	}
	public static String getStatus(int statusId){
		return integer2String.get(statusId);
	}
	public static int getStatusId(String status){
		return string2Integer.get(status);
	}
}
